package phone.qyg.com.qyg.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 作者：lblbh on 2017/11/28 16:32
 * 邮箱：lanbuhan@163.com
 * 功能：场馆列表/新闻列表/超市(资源)列表
 */
public class Base implements Parcelable {

    public int id;
    public String title;
    public String fixImgUrl;
    public String more;//全局对html使用
    public String shareAddress;//全局对html使用


    public int type;//状态选择使用  //全局搜搜使用 1-头 2-尾

    public int hintType;//在筛分条件使用 0隐藏 1显示


    public int relp_id;//课程详情--问题id
    public int user_id;//课程详情--内容使用
    public int ans_user_type;//课程详情--(回复使用)回复类型



    public String url;//文化超市分类-跳转url
    /**
     * "id": 11,
     "title": "APP首页推荐博物馆",
     "fixImgUrl": "http://192.168.1.186:8080/atta/data/content/thumb/2017/11/24/1bb534d5-1fcd-4c79-8de7-9d93f1570e97_466x326.png"
     */


    public Base() {}

    public Base(String title){
        this.title = title;
    }

    public Base(int type,int id,String title){
        this.id = id;
        this.type = type;
        this.title = title;
    }

    public Base(String url,String title){
        this.url = url;
        this.title = title;
    }

    @SuppressWarnings("unchecked")
    public Base(Parcel in) {
        id = in.readInt();
        user_id = in.readInt();
        relp_id = in.readInt();
        url = in.readString();
        more = in.readString();
        title = in.readString();
        fixImgUrl = in.readString();
        shareAddress = in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeInt(user_id);
        dest.writeInt(relp_id);
        dest.writeString(url);
        dest.writeString(more);
        dest.writeString(title);
        dest.writeString(fixImgUrl);
        dest.writeString(shareAddress);
    }


    public static final Creator<Base> CREATOR = new Creator<Base>() {
        @Override
        public Base[] newArray(int size) {
            return new Base[size];
        }

        @Override
        public Base createFromParcel(Parcel in) {
            return new Base(in);
        }
    };
}
